package spilder;

import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

public class Spilder {
    private HttpClient httpClient = HttpClients.createDefault();
    //下载网页
    public String downLoad(String url) throws IOException {
        HttpGet httpGet = new HttpGet(url);
        HttpResponse resp = httpClient.execute(httpGet);
        String str = EntityUtils.toString(resp.getEntity());
        return str;
    }
}
